3.352 \(\int \frac{\tan (e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\)

Optimal. Leaf size=49 \[ -\frac{b}{2 a^2 f \left (a \cos ^2(e+f x)+b\right )}-\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a^2 f} \]

[Out]

-b/(2*a^2*f*(b + a*Cos[e + f*x]^2)) - Log[b + a*Cos[e + f*x]^2]/(2*a^2*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0556289, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {4138, 266, 43} \[ -\frac{b}{2 a^2 f \left (a \cos ^2(e+f x)+b\right )}-\frac{\log \left (a \cos ^2(e+f x)+b\right )}{2 a^2 f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-b/(2*a^2*f*(b + a*Cos[e + f*x]^2)) - Log[b + a*Cos[e + f*x]^2]/(2*a^2*f)

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int \frac{\tan (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{x^3}{\left (b+a x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{x}{(b+a x)^2} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (-\frac{b}{a (b+a x)^2}+\frac{1}{a (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{b}{2 a^2 f \left (b+a \cos ^2(e+f x)\right )}-\frac{\log \left (b+a \cos ^2(e+f x)\right )}{2 a^2 f}\\ \end{align*}

Mathematica [A]  time = 0.505819, size = 79, normalized size = 1.61 \[ -\frac{(a+2 b) \log (a \cos (2 (e+f x))+a+2 b)+a \cos (2 (e+f x)) \log (a \cos (2 (e+f x))+a+2 b)+2 b}{2 a^2 f (a \cos (2 (e+f x))+a+2 b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]/(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-(2*b + (a + 2*b)*Log[a + 2*b + a*Cos[2*(e + f*x)]] + a*Cos[2*(e + f*x)]*Log[a + 2*b + a*Cos[2*(e + f*x)]])/(2
*a^2*f*(a + 2*b + a*Cos[2*(e + f*x)]))

________________________________________________________________________________________

Maple [A]  time = 0.036, size = 59, normalized size = 1.2 \begin{align*} -{\frac{\ln \left ( a+b \left ( \sec \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f{a}^{2}}}+{\frac{1}{2\,fa \left ( a+b \left ( \sec \left ( fx+e \right ) \right ) ^{2} \right ) }}+{\frac{\ln \left ( \sec \left ( fx+e \right ) \right ) }{f{a}^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)/(a+b*sec(f*x+e)^2)^2,x)

[Out]

-1/2/f/a^2*ln(a+b*sec(f*x+e)^2)+1/2/f/a/(a+b*sec(f*x+e)^2)+1/f/a^2*ln(sec(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.993598, size = 77, normalized size = 1.57 \begin{align*} \frac{\frac{b}{a^{3} \sin \left (f x + e\right )^{2} - a^{3} - a^{2} b} - \frac{\log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/2*(b/(a^3*sin(f*x + e)^2 - a^3 - a^2*b) - log(a*sin(f*x + e)^2 - a - b)/a^2)/f

________________________________________________________________________________________

Fricas [A]  time = 0.524192, size = 127, normalized size = 2.59 \begin{align*} -\frac{{\left (a \cos \left (f x + e\right )^{2} + b\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + b}{2 \,{\left (a^{3} f \cos \left (f x + e\right )^{2} + a^{2} b f\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

-1/2*((a*cos(f*x + e)^2 + b)*log(a*cos(f*x + e)^2 + b) + b)/(a^3*f*cos(f*x + e)^2 + a^2*b*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.36198, size = 558, normalized size = 11.39 \begin{align*} \frac{\frac{a^{2} + 2 \, a b + b^{2} + \frac{2 \, a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{4 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{2 \, a b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b^{2}{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}}{{\left (a^{3} + a^{2} b\right )}{\left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}} - \frac{\log \left (a + b + \frac{2 \, a{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac{2 \, b{\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac{a{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac{b{\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{2}} + \frac{2 \, \log \left (-\frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}{a^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/2*((a^2 + 2*a*b + b^2 + 2*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 4*a*b*(cos(f*x + e) - 1)/(cos(f*x + e)
 + 1) - 2*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 2*a*b*(c
os(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((a^3 + a^2*b)*(a + b
 + 2*a*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1
)^2/(cos(f*x + e) + 1)^2 + b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)) - log(a + b + 2*a*(cos(f*x + e) - 1)/
(cos(f*x + e) + 1) - 2*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + a*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 +
 b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/a^2 + 2*log(-(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 1)/a^2)/f